#ifndef linklist_h
#define linklist_h

typedef int ElemType;



// Define the structure of a node
typedef struct Node
{
    ElemType data;
    struct Node *next;
} Node;

typedef struct Node *LinkList;  // LinkList is a pointer to Node

typedef void (*visit)(LinkList node);  // Define a function pointer type

// Function prototypes
LinkList Init_List();           // Initialize an empty linked list
void Destroy_List(LinkList L);  // Destroy a linked list
void Clear_List(LinkList L);    // Clear a linked list
int List_Empty(LinkList L);     // Check if a linked list is empty
int List_Length(LinkList L);    // Get the length of a linked list
int Get_Elem(LinkList L, int i, ElemType *e); // Get the element at position i
int Locate_Elem(LinkList L, ElemType e);      // Locate the element e
int List_Insert(LinkList L, int i, ElemType e);   // Insert an element at position i
int List_Delete(LinkList L, int i, ElemType *e);  // Delete the element at position i
int List_Traverse(LinkList L, visit node_print);  // Traverse the linked list

#endif